package com.zjx.shop.coupon.controller;

import com.zjx.shop.common.utils.R;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 郑家莽
 */
@RefreshScope
@RestController
@RequestMapping("test")
public class ANacosTestController {

    @Value("${coupon.user.name}")
    private String name;

    @Value("${coupon.user.age}")
    private int age;

    @RequestMapping("/nacos")
    public R nacos() {
        Map<String, Object> map = new HashMap<>();
        map.put("name", name);
        map.put("age", age);
        return R.ok(map);
    }
}